<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>insert修改页面</title>
    <!--    先解释jq @{}为绝对路径-->
    <script th:src="@{/webjars/jquery/3.3.1/jquery.min.js}"></script>
    <!--           解释js-->
    <script th:src="@{/webjars/bootstrap/4.3.1/js/bootstrap.min.js}"></script>
    <!--    解释css-->
    <link rel="stylesheet" th:href="@{/webjars/bootstrap/4.3.1/css/bootstrap.min.css}"/>
</head>
<body>
<div>
    <form th:action="@{/user/update}" style="margin: 30px">
<!--        当前页-->
        <input type="hidden" name="curPage" th:value="${curPage}">
        <input type="hidden" name="id" th:value="${user.id}">
        <div class="form-row">
            <div class="form-group col-md-6">
                <label for="inputUsername">用户名</label>
                <input name="userName" th:placeholder="${user.userName}" type="text" class="form-control" id="inputUsername">
            </div>
            <div class="form-group col-md-6">
                <label for="inputPassword">密码</label>
                <input name="password" th:placeholder="${user.password}" type="password" class="form-control" id="inputPassword">
            </div>
        </div>
        <div class="form-row">
            <div class="form-group col-md-6">
                <label for="inputDate">生日</label>
                <input name="birthday"  th:value="${#dates.format(user.birthday,'yyyy-MM-dd')}" type="date" class="form-control" id="inputDate">
            </div>
            <div class="form-group col-md-6">
                <label for="inputState">性别</label>
                <select name="sex" class="custom-select my-1 mr-sm-2" id="inputState">
                    <option th:selected="${user.sex==1}" value="1" selected>男</option>
                    <option th:selected="${user.sex==2}" value="2">女</option>
                    <option th:selected="${user.sex==3}" value="3">未知</option>
                </select>
            </div>
        </div>
        <div class="form-row">
            <div class="form-group col-md-6">
                <label for="inputName">姓名</label>
                <input name="name" th:placeholder="${user.name}" type="text" class="form-control" id="inputName">
            </div>
            <div class="form-group col-md-6">
                <label for="inputAge">年龄</label>
                <input name="age" th:placeholder="${user.age}"  type="password" class="form-control" id="inputAge">
            </div>
        </div>
        <div class="form-group">
            <label for="inputNote">描述</label>
            <input name="note" th:placeholder="${user.note}" type="text" class="form-control" id="inputNote" placeholder="关于你的事">
        </div>
        <button type="submit" class="btn btn-primary">修改</button>
        &nbsp;
        <button type="submit" onclick="javascript:history.back(-1);"  class="btn btn-primary">返回</button>
    </form>
</div>
</body>
<script type="text/javascript">
    // $(function (){
    //     $("#inputDate").blur(function (){
    //        alert(this.val());
    //     })
    // })
</script>
</html>